<template>
	<section class="sidebar" :class="{'w50': !unfold}">
		<v-tip :top="tipTop" :left="tipLeft" :text="tipText" v-show="tipShow">
			<span class="tip-content"><span class="tip-text">{{tipText}}</span></span>
		</v-tip>
		<span class="change"><i class="icon icon-caidan" @click="changeUnfold"></i></span>
		<iScroll :height="listH">
			<div class="list" ref="list">
				<div class="item" 
				v-for="(parObj, index) in menuList"
				:class="{'heightAtuo': detailIndex == index}" 
				@click="changeDetailIndex(index)"
				><p class="item-title" v-bind:data-title="parObj.title"><i class="icon icon-xitong"></i><span class="text">{{parObj.title}}</span></p>
				<article class="item-content">
				<!-- v-show="detailIndex == index" -->
						<p class="content-item" 
							v-for="subObj in parObj.itemList"
							v-bind:data-title="subObj.subTitle"
							@click="changeActiveItem(subObj)"
							:class="{'activeItem': activeItem == subObj.src}"
						><i class="icon" :class="subObj.subIcon"></i><span class="text">{{subObj.subTitle}}</span></p>
					</article>
				</div>
			</div>
		</iScroll >
	</section>
</template>

<script>
	import Vue from 'vue'
	import iScroll from '@/components/utils/iScroll.vue'
	import vTip from '@/components/utils/tip'

	// Vue.use(vIScroll)
	export default{
		name: 'sidebar',
		mounted(){
			var that = this;

			// 获取页面列表 绑定mouse事件 在
			var titleList = document.querySelectorAll('.sidebar .item-title'),
				i = 0,
				len = titleList.length,
				title = null;
			for (; i < len; i++) {
				title = titleList[i];
				title.addEventListener('mouseover', mouseOver ,false)
			}
			// 获取所有的子项目 并绑定事件
			var items = document.querySelectorAll('.sidebar .content-item'),
				k = 0,
				itemLen = items.length,
				item = null;
			for (; k < itemLen; k++) {
				item = items[k];
				item.addEventListener('mouseover', mouseOver ,false)
			}
			var scrollList = document.querySelector('.sidebar .list')
			function mouseOver () {
				if (that.unfold) return;
				
				//获取当前鼠标hover元素的text，top，left
				var title = this.getAttribute('data-title'),
					top = this.offsetTop,
					left = this.offsetLeft;
				// 更新当前tip的 text，top，left
				that.tipShow = true;
				that.tipTop = top - scrollList.scrollTop;
				that.tipLeft = left;
				title != undefined ? that.tipText = title : null;
				
				this.addEventListener('mouseout', function() {
					that.tipShow = false;
				}, false); 
			}

			var setHeightTimer = 0;
			function setHeight () {
				clearTimeout(setHeightTimer)
				setHeightTimer = setTimeout(()=>{
					var h = window.innerHeight - 90;
					that.listH = h;
					
				}, 100)
			}
			
			
			window.addEventListener('resize', setHeight, false);
		},
		data () {
			return {
				unfold: true,//菜单是否收起变量
				activeItem:'',//展开子项目的菜单子项
				detailIndex:0,//展开子项目的菜单子项index
				tipText: '',//提示文本
				tipShow: false,//控制提示文本是否显示
				tipLeft:0,//提示的left
				tipTop:0,//提示的top
				listH: window.innerHeight - 90, //菜单列表的高度
				menuList:[
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-会计管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计凭证查询',
								src: '/count/inquire'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计凭证新增',
								src: '/count/add'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '交易流水表',
								src: '/count/stream'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '期末处理',
								src: '/count/process'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '利息收入明细表(借款人)',
								src: '/count/borrower'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '利息收入明细表(退单)',
								src: '/count/returnorder'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '利息收入明细表(提现手续费)',
								src: '/count/hangingfee'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '投资利息支出明细表',
								src: '/count/detail'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					},
					{
						title:'核算-系统管理',
						icon: 'icon-caidan',
						itemList:[
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型设置',
								src: '/system/business'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '会计科目设置',
								src: '/system/account'
							},
							{
								subIcon: 'icon-hangdongrizhi',
								subTitle: '业务类型会计科目映射设置',
								src: '/system/business&account'
							}
						]
					}
				]
			}
		},
		methods:{
			changeUnfold: function () {//菜单栏切换
				var that = this;
				setTimeout(()=>{
					that.unfold = !that.unfold;
					that.$emit('changeUnfold', that.unfold)
				}, 30)
			},
			changeActiveItem: function (obj) {//切换列表item选中状态
				var str = obj.src;
				str = str.trim();
				if(str == this.activeItem) return;
				str !== undefined ? this.activeItem = str: null;
				this.$emit('updataHistory', obj);
			},
			changeDetailIndex: function (index) {
				typeof index == "number" ? this.detailIndex = index : null;
				
			}
		},
		components:{
			vTip:vTip,
			iScroll
		}
	}
</script>

<style scoped lang="less">
	@import url("../../assets/css/variable.less");
	@import url("../../assets/css/public.less");

	.sidebar{
		&{
			.transition(@property: width;@duration: 0.3s;);
			width: 250px;
			height: 100%;
			background:  @main-tint-bg;
			color: @color;
			line-height: 40px;
			cursor: pointer;
		}
		.change{
			&{
				display: block;
				text-align: center;
				cursor: pointer;
				color: #ddd;
				background: @main-purle-bg;
			}
			&:hover{color: @color;}
			.icon-caidan{
				padding: 10px;
				margin: 0;
			}
		}
		.item-title{
			&{
				height: 40px;
				overflow: hidden;
				background: @main-tint-bg;
			}
			&:hover{
				background: @btn-tint-bg-2;
			}
		}
		.sildebar-wrapper{
			height: 100%;
		}
		.list{
			height: 100%;
			
		}
		.list-wrap{
			height: 100%;
		}

		 /* 自定义滚动条样式 */

		.item-content{
			display:none;
		}
		.heightAtuo{
			&{height: auto;}
			.item-content{
				display: block;
				// max-height: 1000px
			}
		}
		.content-item{
			&{
				padding-left: 16px;
				height: 40px;
			    white-space:nowrap; 
				background: @main-tint-bg;
			}
			&:hover{
				background: @main-purle-bg;
			}
		}
		.content-item.activeItem{
			background: @btn-tint-bg-2;
		}
		.text{
			.transition(@property: opacity;@duration: 0.8s;);
			opacity: 1;
			display: inline-block;
			width: 180px;
			padding-left: 10px;
			margin-left: -10px;
		}
		.content-item.active{
			background: @btn-tint-bg-2;
		}
	}
	.w50 {
		width: 50px;
		.icon{
			margin:0 17px;
		}
		.content-item{
			&{
				padding-left: 0;
			}
			// &:hover .text{
			// 	-webkit-animation:fadeInRight 0.8s .1s ease both;
			// 	-moz-animation:fadeInRight 0.4s .1s ease both;
			// 	animation:fadeInRight 0.4s .1s ease both;
			// 	display: inline-block;
			// }
		}
		.change:hover .text{
			-webkit-animation:fadeInRight 0.8s .1s ease both;
			-moz-animation:fadeInRight 0.4s .1s ease both;
			display: inline-block;
		}
		.text{
			&{
				display: none;
			}
		}
	}
	.tip-content{
		&{
				// display: none;
				display: inline-block;
				padding: 0 10px;
				background: @main-purle-bg;
				-webkit-animation:fadeInRight 0.8s .1s ease both;
				-moz-animation:fadeInRight 0.4s .1s ease both;
				animation:fadeInRight 0.4s .1s ease both;
			}
			&:before{
				content: "";
				position: absolute;
				margin: 10px 0 0 -30px;
				.border(@width: 10px; @type: solid; @color: transparent;);
				border-right-color: @main-purle-bg;
			}
			.tip-text{
				display: inline-block;
				min-width: 180px;
				text-align:center;
			}
	}
	@-webkit-keyframes fadeInRight{
		0%{opacity:0.5;
		-webkit-transform:translateX(16px)}
		100%{opacity:1;
		-webkit-transform:translateX(-10px)}
	}
	@-moz-keyframes fadeInRight{
		0%{opacity:0.5;
		-moz-transform:translateX(16px)}
		100%{opacity:1;
		-moz-transform:translateX(-10px)}
	}
	@-moz-keyframes fadeInRight{
		0%{opacity:0.5;
		transform:translateX(16px)}
		100%{opacity:1;
		transform:translateX(-10px)}
	}



</style>
